#define _CRT_SECURE_NO_WARNINGS 1

#include"string.h"

namespace bit
{
	void teststring1()
	{
		string s1("hello world");
		cout << s1.c_str() << endl;

		string::iterator it1 = s1.begin();
		while (it1 != s1.end())
		{
			cout << *it1 << " ";
			it1++;
		}
		cout << endl;


		for (auto e : s1)
		{
			cout << e;
		}
	}

	void teststring2()
	{
		string s1("hello world");

		s1.push_back('x');
		cout << s1.c_str() << endl;

		s1.append("x");
		cout << s1.c_str() << endl;

		s1.append("yyyyy");
		cout << s1.c_str() << endl;

		s1 += 'u';
		cout << s1.c_str() << endl;
		s1 += "zzzz";
		cout << s1.c_str() << endl;
	}

	void teststring3()
	{
		string s1("hello world");

		//s1.insert(6, 'x');
		//cout << s1.c_str() << endl;

		s1.insert(6, "yyy");
		cout << s1.c_str() << endl;
	}

	void teststring4()
	{
		bit::string s1("hello world");
		bit:: string s2 = s1;
		bit::string s3(s1);

		cout << s1 << endl;
		cout << s2 << endl;
		cout << s3 << endl;

		cin >> s1;
		cout << s1;

	}

	void teststring5()
	{
		bit::string url("https://gitee.com/ailiangshilove/cpp-class/blob/master/%E8%AF%BE%E4%BB%B6%E4%BB%A3%E7%A0%81/C++%E8%AF%BE%E4%BB%B6V6/string%E7%9A%84%E6%8E%A5%E5%8F%A3%E6%B5%8B%E8%AF%95%E5%8F%8A%E4%BD%BF%E7%94%A8/TestString.cpp");
		size_t pos1 = url.find(':');
		bit::string url1 = url.substr(0, pos1 - 0);
		cout << url1.c_str() << endl;

		size_t pos2 = url.find('/', pos1 + 3);
		bit::string url2 = url.substr(pos1 + 3, pos2 - (pos1 + 3));
		cout << url2.c_str() << endl;

		bit::string url3 = url.substr(pos2 + 1);
		cout << url3.c_str() << endl;
	}

}



int main()
{
	//bit::teststring1();
	//bit::teststring2();
	//bit::teststring3();
	//bit::teststring4();
	bit::teststring5();

	/*int area;
	float weight, price = 0.0;
	scanf("%d %f", &area, &weight);

	if (area < 0 || area>4)
	{
		cout << "E I A" << endl;
	}
	else if (area == 0)
	{
		if (weight < 1)
		{
			price = 10;
		}
		else
		{
			weight = ceil(weight);
			price = 10 + (weight - 1) * 3;
		}
	}
	else if (area == 1)
	{
		if (weight < 1)
		{
			price = 10;
		}
		else
		{
			weight = ceil(weight);
			price = 10 + (weight - 1) * 4;
		}
	}
	else
	{
		if (weight < 1)
		{
			price = 15;
		}
		else
		{
			if (area == 2)
			{
				weight = ceil(weight);
				price = 15 + (weight - 1) * 5;
			}
			else if (area == 3)
			{
				weight = ceil(weight);
				price = 15 + (weight - 1) * 6.5;
			}
			else
			{
				weight = ceil(weight);
				price = 15 + (weight - 1) * 10;
			}
		}

	}
	printf("%.2f\n", price);*/
	return 0;
}